# -*- coding: utf-8 -*-

from sqlobject import *
import os
import datetime

class note(SQLObject):
    title=StringCol()
    blocks = MultipleJoin('block')

class block(SQLObject):
    note = ForeignKey('note')
    content = StringCol()
    pos = IntCol()
    create_time = DateTimeCol(default = datetime.datetime.now)
    modify_time = DateTimeCol(default = datetime.datetime.now)
    fold = BoolCol()
    tags = RelatedJoin('tag')


class tag(SQLObject):
    name = StringCol(alternateID=True)
    count = IntCol()
    blocks = RelatedJoin('block')


